//package com.opencenter.v2xexpr.site.io.springrest;
//
//import java.io.IOException;
//import java.util.ArrayList;
//import java.util.List;
//import java.util.Map;
//import java.util.UUID;
//
//import org.opencenter.foundation.JxObject;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.http.HttpHeaders;
//import org.springframework.http.HttpStatus;
//import org.springframework.http.ResponseEntity;
//import org.springframework.web.bind.annotation.PathVariable;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.ResponseBody;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.multipart.MultipartFile;
//
//import com.opencenter.v2xexpr.site.service.JxAppService;
//import com.opencenter.v2xexpr.service.fdb.JxFdb;
//import com.opencenter.v2xexpr.service.fdb.JxFdbNode;
//import com.opencenter.v2xexpr.service.fdb.JxFdbNodeService;
//import com.opencenter.v2xexpr.service.ftp.JxFtpFile;
//import com.opencenter.v2xexpr.service.ftp.JxFtpService;
//
///*
// *  Created by Huangwenhan in 2015.7.29
// * */
//@RestController
//@RequestMapping("/ftproot")
//public class JxFtpController {
//
//	@Autowired
//	@Qualifier(value = "appservice")
//	JxAppService svc;
//
//	protected JxFdb fdb()
//	{
//		return svc.getFdb();
//	}
//
//	@RequestMapping(value = "", method = RequestMethod.GET)
//	public @ResponseBody List<JxFtpFile> getFileDescription(){
//		JxFtpService ftpsvc=new JxFtpService();
//		return ftpsvc.find("");
//	}
//
//
//	@RequestMapping(value= "/{filename}/operation", method = RequestMethod.PUT)
//	public @ResponseBody JxFdbNode importFile(@PathVariable("filename") String filename,@RequestBody JxFtpFile ftpfile1){
//		JxFtpService ftpsvc=new JxFtpService();
//		JxFdbNodeService nodes=(JxFdbNodeService)fdb().getNodes();
//		JxFdbNode fdbnode=new JxFdbNode();
//		JxFtpFile ftpfile=new JxFtpFile();
//
//		String id = nodes.getAutokey();
//		String idex=id+".dat";
//
//		// zhangwei comment the following due to grammar error. please revise it.
//
//		try{
//			ftpfile=ftpsvc.copyFile(filename, idex);
//			fdbnode.setId(id);
//			fdbnode.setOriginname(filename);
//			fdbnode.setStorageid("rawdatafiles");
//			fdbnode.setCurname(id+".dat");
//			fdbnode.setSize(ftpfile.getFilesize().intValue());
//			System.out.println("dddddd:"+ftpfile1.getProperties());
//			fdbnode.setProperties(ftpfile1.getProperties());
//			nodes.create(fdbnode);
//		}catch( Exception e)
//		{
//			e.printStackTrace();
//			return null;
//		}
//
//		return fdbnode;
//	}
//
//	@RequestMapping(value= "/{filename}/", method = RequestMethod.DELETE)
//	public @ResponseBody Integer deleteFile(@PathVariable("filename") String filename){
//
//		JxFtpService ftpsvc=new JxFtpService();
//		ftpsvc.delete(filename);
//		return 0;
//	}
//}
